/**
 * 
 */
package org.xlab.baseframework.web.util;

import java.io.Serializable;

import com.vaadin.data.Item;
import com.vaadin.data.Property.ReadOnlyException;

/**
 * @author makubex
 * 
 */
public class ItemUtil implements Serializable {

	/**
	 * @serialField
	 */
	private static final long serialVersionUID = 2604745866790901635L;

	public static void updateProperties(Item oldItem, Item newItem) {
		for (Object id : newItem.getItemPropertyIds()) {
			try {
				oldItem.getItemProperty(id).setValue(
						newItem.getItemProperty(id).getValue());
			} catch (ReadOnlyException e) {
				continue;
			}
		}
	}
}
